package gqz.testdemo.DrawView;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import gqz.testdemo.R;

/**
 * Created by Administrator on 2018/9/3.
 */

public class DrawViewActivity extends Activity {

    DrawView2 dv;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drawview);
        dv = findViewById(R.id.drawView_dv);
        dv.setBg(getResources().getDrawable(R.drawable.cat));
    }

    public void onclick(View view) {
        switch (view.getId()) {
            case R.id.drawView_btn_normal:
                dv.setMode(0);
                break;
            case R.id.drawView_btn_drag:
                dv.setMode(1);
                break;
            case R.id.drawView_btn_addSize:
                dv.addSize(10, 10);
                break;
            case R.id.drawView_btn_drawBg:
                dv.drawBg();
                break;
            case R.id.drawView_btn_reDraw:
                dv.reDraw();
                break;
        }
    }
}
